package com.dycong.common.network;


import javax.servlet.http.HttpServletRequest;

/**
 * Created by Yu on 2015/3/2.
 */
public class ServletRequestUtil {
//    public static OperatingSystems getServletRequestOperateSystem(String agent){
//        OperatingSystems os;
//        if(agent.contains("iPhone") || agent.contains("iPad")){
//            os = OperatingSystems.iOS;
//        }else if(agent.contains("Android")) {
//            os = OperatingSystems.Android;
//        }else if(agent.contains("Windows")){
//            os = OperatingSystems.Windows;
//        }else{
//            //TODO
//            os = OperatingSystems.Others;
//        }
//        return os;
//    }


    public static String getContextUrl(HttpServletRequest request){
        return request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
    }
}
